#include "StdAfx.h"
#include "Element.h"
#include "VlareElementMemberDefinitions.h"

Vlare::Element::Element(Element* const pParent, const ElementMemberMap props):pParent(pParent), pChildren(0x0), pNext(0x0), m_values(props)
{
	if(pParent)
	{
		Element* pPos = pParent->pChildren;
		pParent->pChildren = this;
		pParent->pChildren->pNext = pPos;
	}
	//TODO: this->m_values[VEM_POSITIONX] = new DynamicData([](){});
}

Vlare::Element::~Element(void)
{
}

Hook& Vlare::Element::operator[](const char* const i)
{
	return (Hook&)*this->m_values.find(i);
}
const Hook& Vlare::Element::operator[](const char* const i) const
{
	return (const Hook&)*this->m_values.find(i);
	//return this->m_values[i];
}